package com.luoxin.servicemap.service;

import com.luoxin.internalcommon.dto.ResponseResult;
import com.luoxin.internalcommon.request.ForecastPriceDTO;
import com.luoxin.internalcommon.response.DirectionResponse;
import com.luoxin.servicemap.remote.MapDirectionClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DirectionService {
    @Autowired
    private MapDirectionClient mapDirectionClient;
    public ResponseResult driving(ForecastPriceDTO forecastPriceDTO) {

        // 调用高德地图接口
        DirectionResponse directionResponse = mapDirectionClient.direction(forecastPriceDTO.getDepLongitude(), forecastPriceDTO.getDepLatitude(), forecastPriceDTO.getDestLongitude(), forecastPriceDTO.getDestLatitude());

        return ResponseResult.success(directionResponse);
    }
}
